<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 思路：设置一个arr1数组，把满足条件的值的移入arr1，则打印arr1.length就是她的个数
    let arr = [2, 6, 18, 15, 40]
    let arr1 = []
    for (let i = 0; i < arr.length; i++) {
      if (arr[i] = arr[i] % 2 === 0 && arr[i] % 3 === 0) {
        arr1.push(arr[i])
      }
    }
    console.log(arr1.length);
  </script>
</body>

</html>